package cn.neo.hhrpc.core.registry;

import cn.neo.hhrpc.core.meta.InstanceMeta;
import cn.neo.hhrpc.core.meta.ServiceMeta;
import cn.neo.hhrpc.core.registry.ChangedListener;

import java.util.List;

/**
 * 注册中心
 */
public interface RegistryCenter {


    void start();

    void stop();

    // provider侧
    void register(ServiceMeta service, InstanceMeta instance);

    void unregister(ServiceMeta service, InstanceMeta instance);

    // consumer侧
    List<InstanceMeta> fetchAll(ServiceMeta service);

    // 订阅
    // ChangedListener监听者，用于修改外部结构
    void subscribe(ServiceMeta service, ChangedListener listener);
//    void heartbeat();


}
